//----------------------------------------------------------------------------------------------------------//
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//    I BBMMBB      BBMMBBI     BBI EEMMFFI BBMMI     BBI EEMMFFI BBMMI       BBMMBBI   EEMMI EEMMLL        //
//    EEI   EEFF  EEI   LLBB  EEMMBBI I BBEE  I EE  EEMMBBI I BBEE  I EE    EEI   LLBB    EEBBI I BB        //
//  I FF        I EE      BBI   EEI     EEI   I EE    EEI     EEI   I EE  I EE      BBI   EEI   I EE        //
//  LLFF        LLEE      EELL  EEI     EEI   I EE    EEI     EEI   I EE  LLEE      EELL  EEI   I EE        //
//  I EE      I I BB      EEI   EEI     EEI   I EE    EEI     EEI   I EE  I BB      EEI   EEI   I EE        //
//    BBLL  I I   BBFF  I EE    EEI     EEI   I BB    EEI     EEI   I BB    BBFF  I EE    BBI   I EE        //
//    I BBMMEE    I BBMMBB    EEMMMMLLBBMMBBLLMMMMEEEEMMMMLLBBMMBBLLMMMMEE  I BBMMBB    EEMMMMLLBBMMBB      //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//----------------------------------------------------------------------------------------------------------//
//                                                                                                          //
//                                                Scott System                                              //
//                                                                                                          //
//                               (c) Copyright 2006-2007, Scottyu China                                     //
//                                                                                                          //
//                                           All Rights Reserved                                            //
//                                                                                                          //
// File    : file.h                                                                                         //
// By      : scottyu                                                                                        //
// Version : V1.00                                                                                          //
// Time    : 2007-12-13 15:50:23                                                                            //
//                                                                                                          //
//----------------------------------------------------------------------------------------------------------//
//                                                                                                          //
// HISTORY                                                                                                  //
//                                                                                                          //
// 1 2007-12-13 15:50:23                                                                                    //
//                                                                                                          //
//                                                                                                          //
//                                                                                                          //
//----------------------------------------------------------------------------------------------------------//


#ifndef __FILE__H__
#define __FILE__H__	1

#include "basetypes.h"
#include "error.h"

#ifdef _WINDOWS
#include <windows.h>

//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 RemoveFile( const char  * filename);

//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 DeleteSingleFile( const char * FullPath);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 CreateDir( s8 * dir, void * para);


u32 makedir(const char * dir);


u32 removedir( const char * dir);
//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 DeleteDir( s8 * dir);

//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 DeleteFullDirectory(s8 * Path);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 GetFileLength( s8 * filename);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 GetFileData(s8 * file, u8 * buffer, u32 Size);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
//s8 *GetModuleDirectory();


u32 GetModuleDirectory(char * dir);

//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 IsFileExist(const char * szFilePath);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 IsDirExist( s8 *szDir);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 IsDirectory(WIN32_FIND_DATA * pfinddata);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 IsDot(WIN32_FIND_DATA * pfinddata);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 IsDotDot(WIN32_FIND_DATA * pfinddata);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
void ShowInNotepad(s8 * file);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 Bin2Cdata(s8 * filename, u32 startaddress);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 Bin2CdataWithLen(s8 * filename, u32 startaddress, u32 length);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 Bin2CdataWithAddr(s8 * filename, u32 startaddress, u32 endaddress);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 GetFileExt(s8 * szFileFullPath, s8 * ext);


//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 GetFileName(s8 * szFileFullPath, s8 * filename);

//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------
u32 SaveDataToFile(u8 * buffer, s8 * filename, u32 startaddr, u32 length, s8 * ext);

//------------------------------------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------------------------------------

#ifdef SCRIPT_LUA
/*
static int proxy_Bin2Cdata(lua_State *L);
static int proxy_Bin2CdataWithLen(lua_State *L);
static int proxy_Bin2CdataWithAddr(lua_State *L);
*/
#endif //

//------------------------------------------------------------------------------------------------------------
// THE END !
//------------------------------------------------------------------------------------------------------------
#endif //__FILE__H__

#endif //_WINDOWS